home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1986 February
/
Ahoy_Magazine_86-02_1986_Double_L.d64
/
head to head
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
5KB
|
195 lines
1 rem *********************************
2 rem * *
3 rem * 'head to head' (c) 1985 *
4 rem * by doug smoak *
5 rem * 303 heyward st. *
6 rem * columbia, s.c. *
7 rem * 29201 *
8 rem * *
9 rem *********************************
10 dima(3),x(4),c(4)
20 a(0)=2:a(2)=-80:a(1)=-2:a(3)=80
30 x(0)=0:x(1)=-40:x(2)=40:x(3)=-1:x(4)=1
40 c(0)=0:c(1)=30:c(2)=22:c(3)=60:c(4)=62
50 bo=53280:bg=bo+1:sc=1024:wl=160:hl=46
60 sid=54272:cd=sid
70 dn$=""
80 ds$=dn$+""
90 gosub880:pokebo,0:pokebg,0:poke646,14
100 gosub1600
110 fori=49152to49152+213
120 reada:pokei,a:next
130 gosub1130
140 print"[147][155]"dn$"bonus feature y/n[146]";
150 inputbs$
160 print"[147]"dn$"how many rounds";
170 inputrd$:rd=val(rd$)
180 ifrd=0thenrd=1
190 :
200 rem ** main loop **
210 :
220 forii=1tord
230 pokebo,0:pokebg,0
240 m1=1905:m2=1925:c1=30:c2=c1:tp=0
250 poke198,0
260 print"[147]"dn$"what number maze";
270 inputmz$:mz=val(mz$):mz$=""
280 print"[147]":ifmz=0thenmz=rnd(1)
290 fori=0to22
300 print" [146]";
310 next
320 a9=sc+81:gosub670:mz=0
330 ifbs$<>"y"then390
340 x=int(rnd(1)*5)+2
350 y=int(rnd(1)*8)+2
360 fori=sc+x*40+ytosc+x*40+19
370 ifpeek(i)=160thenpokei,86:pokei+20,86:pokei+cd,7:pokei+20+cd,7:goto390
380 next
390 ti$="000000"
400 pokem1,c1:pokem2,c2
410 o1=m1:o2=m2
420 poke49301,255:sys49223
430 print"[158]round"iitab(20)"sec"10-val(right$(ti$,2))"[157] "
440 ifval(right$(ti$,2))<10then430
450 sys49152:j1=peek(253)
460 m1=o1+x(j1):w1=peek(m1)
470 ifw1=c1orw1=wlthen520
480 ifw1=hlthentp=tp+1:p1=p1+10:pokem1+20,32
490 ifw1=86thenp1=p1+500:pokem1+20,32
500 pokeo1,32:pokem1,c(j1)
510 o1=m1:c1=c(j1):goto530
520 m1=o1
530 sys49152:j2=peek(254)
540 m2=o2+x(j2):w2=peek(m2)
550 ifw2=c2orw2=wlthen600
560 ifw2=hlthentp=tp+1:p2=p2+10:pokem2-20,32
570 ifw2=86thenp2=p2+500:pokem2-20,32
580 pokeo2,32:pokem2,c(j2)
590 o2=m2:c2=c(j2):goto610
600 m2=o2
610 print"[158]score"p1tab(20)"score"p2
620 iftp>=196thensys49287:gosub880:gosub1090:nextii:goto920
630 goto450
640 :
650 rem *** create playfield ***
660 :
670 zm=rnd(-mz)
680 j=int(rnd(1)*4):x3=j
690 b=a9+a(j)
700 ifpeek(b)=wlthengosub800:goto680
710 j=(j+1)*-(j<3):ifj<>x3then690
720 j=peek(a9)
730 pokea9,hl:pokea9+cd,1
740 pokea9+20,hl:pokea9+cd+20,1
750 ifj<4thena9=a9-a(j):goto680
760 return
770 :
780 rem *** playfield sub ***
790 :
800 pokeb,j:pokea9+a(j)/2,hl
810 pokea9+cd+a(j)/2,1
820 pokeb+20,j:poke(a9+a(j)/2)+20,hl
830 poke20+a9+cd+a(j)/2,1:a9=b
840 return
850 :
860 rem ** setup sound chip **
870 :
880 fori=0to24:pokesi+i,0:next:pokesi+24,15:pokesi+6,240:return
890 :
900 rem *** game over ***
910 :
920 ifp1>p2thenpl$="player one, that's you on the left!":goto950
930 ifp2>p1thenpl$="player two, that's you on the right!":goto950
940 ifp2=p1thenpl$=" nobody, it's a tie!!!??"
950 print"[147][158]the final scores are:"
960 print"player one:"p1
970 print"[158]player two:"p2
980 print"[158]the winner is:"
990 print""pl$
1000 print"[158] play again y/n[146] ?";
1010 fori=1to1000:next:poke198,0
1020 geta$
1030 ifa$="n"thenprint"[147]";:end
1040 ifa$<>"y"then1020
1050 p1=0:p2=0:rd=0:ii=0:goto140
1060 :
1070 rem *** check for end ***
1080 :
1090 ifrd>0andii=rdthenreturn
1100 :
1110 rem *** wait for input ***
1120 :
1130 print"[129]press return to continue";
1140 cl=rnd(0)*15+1
1150 ifrd=0thenpoke646,cl:gosub1600:printds$"by doug smoak "
1160 if(peek(197)<>1)then1140
1170 poke198,0:return
1180 :
1190 rem ** m.l. j-stick data **
1200 :
1210 data169,0,133,254,173,0,220
1220 data74,176,4,160,1,132,254,74
1230 data176,4,160,2,132,254,74,176
1240 data4,160,3,132,254,74,176
1250 data4,160,4,132,254,169,0,133
1260 data253,173,1,220,74,176,4
1270 data160,1,132,253,74,176,4
1280 data160,2,132,253,74,176,4,160
1290 data3,132,253,74,176,4,160
1300 data4,132,253,96
1310 :
1320 rem ** interrupt music data **
1330 :
1340 data120,169,84,141,20,3,169
1350 data192,141,21,3,88,96,173,148
1360 data192,208,40,174,149,192
1370 data232,224,64,208,2,162,0,189
1380 data150,192,141,0,212,232,189
1390 data150,192,141,1,212,232,189
1400 data150,192,141,4,212,232,189
1410 data150,192,141,148,192,142,149
1420 data192,206,148,192,76,49,234
1430 data120,169,49,141,20,3,169
1440 data234,141,21,3,88,96
1450 data 0,255
1460 :
1470 rem ** music notes data **
1480 :
1490 data 96,22,17,15,195,16,17,15
1500 data 24,14,17,15,195,16,17,15
1510 data 96,22,17,15,195,16,17,15
1520 data 24,14,17,15,195,16,17,15
1530 data 239,14,17,15,195,16,17,15
1540 data 239,14,17,15,195,16,17,15
1550 data 239,14,17,15,195,16,17,15
1560 data 209,18,17,15,31,21,17,15
1570 :
1580 rem *** title page ***
1590 :
1600 print" ";
1610 print" [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174][146] ";
1620 print" [221][146] [221][146] ";
1630 print" [221][146] [146] [146] [146] [169] [223][146] [223][146] [221][146] ";
1640 print" [221][146] [146] [146] [146] [146] [146] [146] [146] [221][146] ";
1650 print" [221][146] [162] [146] [162][146] [162] [146] [146] [146] [221][146] ";
1660 print" [221][146] [146] [146] [146][162][162] [146] [146] [146][162] [146] [221][146] ";
1670 print" [221][146] [221][146] ";
1680 print" [221][146] [146] [146] [221][146] ";
1690 print" [221][146] [146] [146] [146] [221][146] ";
1700 print" [221][146] [146] [146] [146] [221][146] ";
1710 print" [221][146] [146] [146][162] [146] [221][146] ";
1720 print" [221][146] [221][146] ";
1730 print" [221][146] [146] [146] [146] [169] [223][146] [223][146] [221][146] ";
1740 print" [221][146] [146] [146] [146] [146] [146] [146] [146] [221][146] ";
1750 print" [221][146] [162] [146] [162][146] [162] [146] [146] [146] [221][146] ";
1760 print" [221][146] [146] [146] [146][162][162] [146] [146] [146][162] [146] [221][146] ";
1770 print" [221][146] [221][146] ";
1780 print" [221][146] by doug smoak [221][146] ";
1790 print" [221][146] [221][146] ";
1800 print" [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189][146] ";
1810 print" ";
1820 print" ";
1830 print" ";
1840 poke646,rnd(0)*15+1
1850 return